CodeAgent had been baked into the core amd-gaia wheel, so it could only ship
on the framework's release cycle and any RoutingAgent import dragged the whole
code stack into the core. CodeAgent now ships as the standalone gaia-agent-code
wheel under hub/agents/python/code/, discovered via the gaia.agent entry-point
group; RoutingAgent stays in the framework and resolves it lazily through the
registry, so the core no longer hard-depends on it.
- Move src/gaia/agents/code/ -> hub/agents/python/code/gaia_agent_code/ with
build_registration(), pyproject (gaia-code console script), gaia-agent.yaml,
and README mirroring the jira package.
- RoutingAgent uses AgentRegistry().create_agent("code", ...) and raises a
loud, actionable error when the wheel is absent (no silent fallback).
- setup.py: drop code packages + the gaia-code console script; add the
agent-code extra and code to [agents].
- Move code-specific tests into the package; test_sdk gates them via
pytest.importorskip("gaia_agent_code"); restore the write-guardrail tests'
tool accessor so that coverage runs again.
- Update test_code_agent.yml to install the wheel and run from the new paths;
drop gaia-code from the amd-gaia publish smoke check.
Why this matters
CodeAgent was baked into the core
amd-gaiawheel, so it could only ship on the framework's release cycle andRoutingAgenthard-imported the entire code stack at module load. After this change, CodeAgent ships as an independentgaia-agent-codewheel (hub/agents/python/code/), discovered via thegaia.agententry-point group like the other migrated agents.RoutingAgentstays in the framework and now resolves CodeAgent lazily through the registry (AgentRegistry().create_agent("code", ...)), so the core no longer depends on the code package — and fails loudly with an actionable install hint if the wheel is missing. Completes thecoderow of #1397 (legacy modernization) and #1102 (move production agents tohub/agents/).Test plan
python util/lint.py --agents— clean (2 pre-existing docqa/emr warnings, unrelated)python util/lint.py --black --isort --fix— clean;black --check hub/agents/python/code/cleanuvx pylint src/gaia -E --rcfile .pylintrc --disable C0103,C0301,W0246,W0221,E1102,R0401,E0401,W0718,W0212— clean (only the ignorable Windowsos.geteuidE1101)pytest tests/unit/agents/test_routing_agent.py tests/unit/agents/test_registry.py tests/unit/test_agent_required_connectors.py tests/unit/test_errors.py tests/unit/test_code_index_mixin.py— 144 passedtest_code_agent.yml):pytest hub/agents/python/code/tests/test_code_agent_mixins.py hub/agents/python/code/tests/test_code_agent.py::TestCodeAgent -k "not workflow and not integration and not process_query"+ validators + guardrails +TestCodeAgentIntegration— greengaia_agent_code.build_registration()returnsid=code, source=installed, namespaced_agent_id=installed:code;gaia-codeconsole script resolves togaia_agent_code.cli:maintests/test_api.py+tests/mcp/test_agent_mcp_server.pycollect with no import errors (api_registry change is docstring-only)gaia.agents.codeimports remain (the twogaia/agents/codestrings inerrors.pyFRAMEWORK_PATHS are intentionally kept, matching the jira/blender/docker migrations)Notes for the reviewer
tests/unit/cli/test_cli_smoke.pymay show a stalegaia-code -> gaia.agents.code.clientry only in a dev environment with a previously editable-installedamd-gaia(the documented worktree gotcha). A clean install picks up the updatedsetup.py(nogaia-code) and passes.test_external_tools,run_npm_commandregistry drift intest_typescript_tools,process_queryLLM tests, andhasattrassertions in the ungatedtest_sdkcode-mixin checks). All were verified to fail identically onmain; fixing them is out of scope for this migration.